/*************************************************************************
	> File Name: 2.hzoj166.cpp
	> Author: 
	> Mail: 
	> Created Time: 日  6/ 6 15:28:55 2021
 ************************************************************************/

#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
using namespace std;

int main() {
    string a, b;
    int pos;
    cin >> a >> pos >> b;
    cout << min(100, (int)a.size()) << endl; // a.length();
    a.insert(pos - 1, b);
    cout << a << endl;
    cout << a.length() - a.rfind('x') << endl;

    return 0;
}
